package cn.bdqn.service.impl;

import cn.bdqn.dao.UserDao;
import cn.bdqn.dao.impl.UserDaoImpl;
import cn.bdqn.dao.impl.UserMySqlImpl;
import cn.bdqn.dao.impl.UserOracleImpl;
import cn.bdqn.service.UserService;

public class UserServiceImpl implements UserService {

    /**
     * 原来的  new不同的实现类来实现不同的方法
     * private UserDao userDao = new UserDaoImpl();
     * private UserDao userDao = new UserMySqlImpl();
     * private UserDao userDao = new UserOracleImpl();
     */

    /**
     *  现在的
     *  通过set方法动态实现
     */
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void getUser() {
        userDao.getUser();
    }
}
